package ade.prime.service;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author		Schnell Michaël
 * @version		1.0
 */
public enum ScheduleUpdateProgress implements Parcelable {
	
	STEP_1( 5), // Connected to ADE 
	STEP_2( 5), // Project set
	STEP_3(45), // Lessons feed obtained
	STEP_4(10), // Lessons feed analyzed
	STEP_5(15), // Compared with previous schedule
	STEP_6(20) ;// Schedule updated

	public static final Parcelable.Creator<ScheduleUpdateProgress> CREATOR = 
			new Creator<ScheduleUpdateProgress>() {
		@Override
		public ScheduleUpdateProgress[] newArray(int size) {
			return new ScheduleUpdateProgress[size] ;
		}// newArray(int)
		
		@Override
		public ScheduleUpdateProgress createFromParcel(Parcel source) {
			return ScheduleUpdateProgress.values()[source.readInt()] ;
		}// createFromParcel(Parcel)
	} ;
	
	protected int weight ;
	
	/**
	 * 
	 */
	private ScheduleUpdateProgress(int weight) {
		this.weight = weight ;
	}// ScheduleUpdateProgress(int)
	
	/**
	 * @return the weight
	 */
	public int getWeight() {
		return this.weight; 
	}// getWeight()
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public int describeContents() {
		return 0 ;
	}// describeContents()

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(this.ordinal()) ;
	}// writeToParcel(Parcel dest, int)

}// enum ScheduleUpdateProgress